﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace THenu.TinyHourseLib.DesignPattern.Specification_Pattern.Example
{
    /// <summary>
    /// 为特定类型创建规格的产生器
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PremiumGril<T> : CompositeSpecification<T>
        where T : MyGirl
    {
        float height = 0;
        float weight = 0;
        /// <summary>
        /// 传入创建规格的期望值
        /// </summary>
        /// <param name="height"></param>
        /// <param name="weight"></param>
        public PremiumGril(float height, float weight)
        {
            this.height = height;
            this.weight = weight;
        }
        public override bool IsSatisfiedBy(T obj)
        {
            return obj.Height > height && obj.Weight < weight;
        }
    }
}
